<style>
#date-type{display:inline-block;}
#date-type a{display:inline-block;margin:0 10px;}
#date-type a span{background-color:#3891CA;color:#fff;padding:10px 30px;display:block;}
#date-search{float:right;display:inline-block;vertical-align: top;line-height:30px;}
#date-search b{font-size:18px;font-weight: 400;color:#3891CA;}


.a-hot-article div{padding-bottom:8px;}

</style>
<div style="border-bottom:1px solid #3891CA;">
	
	<div id="date-search">
		<form method="get" action="<?=n_url('article', 'articlesDaily')?>">
			统计截止：<?=date('m月d日 H时', $data['total']['ctime'])?> 
			文章<b>[<?=$data['total']['article_total']?>]</b>篇，
			阅读<b>[<?=round($data['total']['read_total']/10000)?>万]</b>次，
			点赞<b>[<?=round($data['total']['like_total']/10000)?>万]</b>次
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="">数据说明</a>
			<input type="hidden" name="category", value="<?=urlencode($data['category'])?>">
			<input type="text" class="n-calendar" name="date" value="<?=date('Y-m-d', $data['date'])?>"/>
			<button>提交</button>
			
		</form>
	</div>
	<div id="date-type">
		<a href="<?=n_url('article', 'articlesDaily')?>"><span>日榜</span></a>
		<a href="<?=n_url('article', 'articlesWeekly')?>"><span>周榜</span></a>

	</div>
</div>




<div style="margin-top:10px">

	
	<div id="catetree-list" style="float:left;width:200px;">
		<?php

		foreach($data['cateTree'] as $key=>$val){
		?>
			<div class="catetree-list">
				<?=$key?>
			</div>
			<div class="subcatetree-list">
			<?php
			foreach ($val as $key1=>$val1){
			?>
				<a href="<?=n_url('article', 'articlesDaily', ['cid' => $val1['id'], 'date' => date('Y-m-d', $data['date'])])?>"<?=$data['category']['second_category']==$val1['second_category']?' class="cate-current"':''?>><?=$val1['second_category']?></a>
			<?php
			}
			?>
			</div>
		<?php
		}
		?>

	</div>	
	
	
	
	<dl class="n-box" style="margin-left:250px;">
		<dt class="n-box-head">
			<b><?=$data['category']['second_category']?>热文排行榜</b>
		</dt>
		<dd id="article-list" class="n-box-body">
		<?php foreach($data['hot_articles'] as $article):?>

			<div class="a-hot-article" style="padding-top:10px;">
				<img style="width:100px;height:60px;border:1px solid #999;padding:2px;margin-right:10px;" src="<?=get_weixin_thumbnail($article['article_mongoid'])?>">

				<div class="a-bottom-line n-sep-bottom">
					
					<p style="font-size:16px;">
						<!--span>
							公共号:<?=$article['url']?>
						</span-->
						<a href="<?=$article['url']?>" target="_blank"><?=$article['title']?></a>&nbsp;
					</p>
					
					<p class="a-summry">
						<?=$article['content168']?>&nbsp;　
					</p>
					<p style="margin-top:10px;">
						阅读<b class="read-num"><?=$article['read_num']?></b>，
						点赞<b class="like-num"><?=$article['like_num']?></b>，
						发布日期<span class="ptime"><?=date('Y-m-d H:i:s', $article['article_ptime'])?></span>
					</p>
				</div>
			</div>
		<?php endforeach;?>
		</dd>

		<?php
		if(count($data['hot_articles'])==10){
		?>
		<div class="more-page">
			<a href="javascript:void(0);" onclick="more()">更多</a>
		</div>
		<?php
		}
		?>
	</dl>
	
</div>



<script>
var page = 1;
var cid = "<?=urlencode($data['category']['id'])?>";
var day = "<?=date('Y-m-d', $data['date'])?>";
var num = "<?=$count?>";
function more(){

	if(page==-1){
		$(".more-page").hide();
		return ;
	}
	page++;
	$.getJSON("<?=n_url('article', 'articlesDailyMore')?>",{cid:cid,date:day,page:page},function(data){
		if(!data.state){
			$(".more-page").hide();
			page=-1;
		}else{
			if(data.data.length!=10){
				$(".more-page").hide();
				page=-1;				
			}
			
			for(i in data.data){
				item = data.data[i];
				var template = $(".a-hot-article").eq(0).clone(true);
				template.find("img").attr("src","/static/weixin_thumbnail/"+data.data[i]['article_mongoid']+".jpg");
				template.find("h3 a")
								.attr("href",data.data[i]['url'])
								.attr("target","_blank")
								.text(data.data[i]['title']);
				template.find(".a-summry").text(item['content168'])
				template.find(".read-num").text(item['read_num'])
				template.find(".like-num").text(item['like_num'])
				template.find(".ptime").text(item['ptime'])
				

				template.appendTo("#article-list")
			}
		}
	});
}
</script>

